<template>
  <div id="app">
    <transition name="fade">
      <router-view></router-view>
    </transition>
  </div>
</template>

<script>
export default {
  name: 'App',
  created () {
    this.setIcon()
  },
  methods: {
    setIcon () {
      // 根据分平台标识动态获取ico
      let that = this
      let link = document.querySelector("link[rel*='icon']") || document.createElement('link')
      link.type = 'image/x-icon'
      link.rel = 'shortcut icon'
      link.href = REMOTESTATICPATH + that.GLOBAL.getPlatFormCodeByUrl() + '/favicon/favicon.ico'
      let $icon = document.getElementsByTagName('head')[0].appendChild(link)
      let _img = new Image()
      _img.src = link.href
      _img.onerror = function () {
        $icon.href = REMOTESTATICPATH + PLATCOEDEFAULT + '/favicon/favicon.ico'
      }
    }
  }
}
</script>

<style lang="scss">
body {
  margin: 0px;
  padding: 0px;
  /*background: url(assets/bg1.jpg) center !important;
    background-size: cover;*/
  font-family: "Hiragino Sans GB","PingFang SC","Microsoft YaHei";
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: absolute;
  top: 0px;
  bottom: 0px;
  width: 100%;
  min-width: 1600px;
  height: 100%;
}

.el-submenu [class^=fa] {
  vertical-align: baseline;
  margin-right: 10px;
}

.el-menu-item [class^=fa] {
  vertical-align: baseline;
  margin-right: 10px;
}

.toolbar {
  background: #f2f2f2;
  padding: 10px;
  margin: 10px 0px;
  .el-form-item {
    margin-bottom: 10px;
  }
}

.fade-enter-active,
.fade-leave-active {
  transition: all .2s ease;
}

.fade-enter,
.fade-leave-active {
  opacity: 0;
}
</style>
